﻿
-- ================================================
-- Remarks: Hard delete is required on specific rows
-- so check for delete type
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'Dasideen_Sys_ErrorLog_DeleteByDate')
	BEGIN
		DROP  Procedure  Dasideen_Sys_ErrorLog_DeleteByDate
	END
GO

CREATE PROCEDURE [Dasideen_Sys_ErrorLog_DeleteByDate]
-- =============================================
-- Author:		<Sagar>
-- Create date: <14/06/2015>
-- Description:	<Dasideen_Sys_ErrorLog_DeleteByDate>
-- =============================================
-- Add the parameters for the stored procedure here
(
    @Sys_DateOfCreation datetime,
	--@ConcurrencyTimeStamp datetime  = NULL,
	@FromDate datetime,
    @ToDate datetime			
) 
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	DELETE FROM [Sys_ErrorLog]
	WHERE 
	    (
			 @Sys_DateOfCreation BETWEEN @FromDate AND @ToDate
		)
	
 END
 GO

